/*这里放一些对于接口来说的公共的接口，在大部分的页面都可能会用到的调用方法*/
import axios from '@/utils/request'

/***获取服务器时*/
export function getNetworkTimeApi () {
  return axios({
    url: `/coupon/currentTime?t=${new Date().getTime()}`,
    method: 'get'
  })
}

/*** 是否领取过卷*/
export function isGetCouponApi(userId,version) {
  return axios({
    url: `/coupon/userCoupon?t=${new Date().getTime()}`,
    method: 'post',
    data: { userId:userId,version:version}
  })
}

/*****领取优惠券****/
export function getCouponList(userId,couponId,version){
  return axios({
    method:'post',
    url:`/coupon/userCollectCoupon?t=${new Date().getTime()}`,
    data:{userId:userId,couponIds:couponId,version:version}
  })
}

/*****领取全场券(不重复)状态****/
export function getGlobalCouponList(userId,couponId){
  return axios({
    method:'post',
    url:`/Coupon/getGlobalCoupon?t=${new Date().getTime()}`,
    data:{userId:userId,couponId:couponId}
  })
} 

/*****获取用户的券列表****/
export function getUserCouponStatusList(userId,couponId){
  return axios({
    method:'post',
    url:`/Coupon/getUserCouponStatus?t=${new Date().getTime()}loading=1`,
    data:{userId:userId,couponId:couponId}
  })
} 

/*****获取商品****/
export function getGoodsListApi(goodsIds){
  return axios({
    method:'get',
    url:`/goods/getgoods?t=${new Date().getTime()}`,
    params:{goodsIds:goodsIds}
  })
}

/*****设置秒杀提醒****/
export function setRemindApi(userId,goodsId,pushTime){
  return axios({
    method:'get',
    url:`/AprilMemberJuneDay/remind?t=${new Date().getTime()}`,
    params:{userId,goodsId,pushTime}
  })
}

/*** 更多专区专场*/
export function handleMoreApi (specialId) {
  return axios({
    url: `/Special/getSpecials?t=${new Date().getTime()}`,
    method: 'get',
    params: { specialId: specialId}
  })
}